var map
var marcador

function initialize() {
	var latlng = new google.maps.LatLng(-12.097, -77.0302);
    var mapOptions = {
        center: latlng,
        zoom: 16,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById("map_canvas"),mapOptions);
    var image = 'images/Marker-Red.png';
    marcador = new google.maps.Marker( {
		position: latlng,
		map:map,
    icon:image	})
}

/*
  function initialize() {
    var latlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
      zoom: 15,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP      
    };
    console.log(document.getElementById("map_canvas"));
    map = new google.maps.Map(document.getElementById("map_canvas"),
        myOptions);
    marcador = new google.maps.Marker( {
		position: latlng,
		map:map	
	})
  }
  
  function mostrarUbicacion(){
		navigator.geolocation.getCurrentPosition( lecturaGPS , errorGPS , {enableHighAccuracy:true} )  
  }
  
  function lecturaGPS(ubicacion){
	  
	  var miubicacion = new google.maps.LatLng(ubicacion.coords.latitude, ubicacion.coords.longitude);
	  
	  map.setCenter(miubicacion)
	  marcador.setPosition(miubicacion)
	  
  }
  
  function errorGPS(){
	  alert(" no puedo encontrarte :(")
  }	
*/
$().ready(function(){
	//mostrarUbicacion();
  var nav = $('.nav');
  $(window).scroll(function(){    
    if($(this).scrollTop() > 160){
      nav.addClass("flotante-nav");      
    }else{
      nav.removeClass("flotante-nav");
    }
  });
});